from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

driver = webdriver.Edge()
driver.get('http://baidu.com')
driver.maximize_window()
sleep(2)

# 搜索框输入
driver.find_element(By.ID,'kw').send_keys('自动化测试')
sleep(1)
# 点击搜索
driver.find_element(By.ID,'su').click()
sleep(2)
# 滚动到底部
driver.execute_script('window.scrollTo(0,document.body.scrollHeight)')
sleep(2)
# 翻到第3页
driver.find_element(By.XPATH,'//*[@id="page"]/div/a[2]/span').click()



sleep(5)
